/**
 * Copyright 2010 Victor Egea Hernando
 *
 * RockScript is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 * 
 * RockScript is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with RockScript.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PAIR_H_
#define PAIR_H_

#include "../types.h"

namespace corelib{

template <typename TA, typename TB>
class pair
{

public:
    // values
    TA first; TB second;

public:
    // empty constructor
    pair( void )
    {

    }
    // constructor
    pair( const TA &a, const TB &b )
	: first( a ), second( b )
    {

    }
    // copy constructor
    pair( const pair &p )
        : first( p.first ), second( p.second )
    {

    }
    // compares the pair '=='
    bool operator == ( const pair &p ) const{
        return (first==p.first) && (second==p.second);
    }
    // compares the pair '<'
    bool operator < ( const pair &p ) const{
		return (first < p.first) ? true : (first > p.first) ? false : (second < p.second);
    }
};

}; // namespace corelib;

#endif //PAIR_H_

